<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<style>
    #photo {
        max-width: 100%;
        max-height: 350px;
    }
</style>
<!--style="overflow-y:hidden;"-->
<body class="hold-transition skin-green sidebar-mini"  style="overflow: hidden;">
<!--修改密码-->
<div class="modal fade" id="modal-updatePassword">
    <div class="modal-dialog">

        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">修改密码</h4>
            </div>
            <div class="modal-body">
                <form id="userForm" class="form-horizontal" role="form">
                    <div class="form-group">
                        <label for="password" class="col-sm-2 control-label no-padding-right">新的密码</label>
                        <div class="col-sm-10">
                            <input type="password" class="form-control" id="password" name="password"
                                   placeholder="请输入新密码">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="rePassword" class="col-sm-2 control-label no-padding-right">重复密码</label>
                        <div class="col-sm-10">
                            <input type="password" class="form-control" id="rePassword" name="rePassword"
                                   placeholder="请再输入一次">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-info" id="btn-updatePassword">确定</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!--修改头像-->
<div class="modal fade" id="modal-upload">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">修改头像</h4>
            </div>
            <div class="modal-body">
                <p class="tip-info text-center">
                    未选择图片
                </p>
                <div class="img-container hidden">
                    <img src="" alt="" id="photo">
                </div>
                <div class="img-preview-box hidden">
                    <hr>
                    <span>150*150:</span>
                    <div class="img-preview img-preview-lg">
                    </div>
                    <span>100*100:</span>
                    <div class="img-preview img-preview-md">
                    </div>
                    <span>30*30:</span>
                    <div class="img-preview img-preview-sm">
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <label class="btn btn-danger pull-left" for="photoInput">
                    <input type="file" class="sr-only" id="photoInput" accept="image/*">
                    <span>打开图片</span>
                </label>
                <button type="button" class="btn btn-info disabled" disabled id="btn-upload" onclick="sendPhoto()">确定
                </button>
                <p style="color:red;margin-top: 8px;margin-left: 20px" class="pull-left">比例 1 ：1 建议尺寸 300 x 300</p>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<div class="wrapper">

    <header class="main-header">
        <a class="logo">
            <span class="logo-lg"><b style="float:left">商务管理系统</b></span>
        </a>
        <nav class="navbar navbar-static-top">
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" title="菜单缩放" role="button"></a>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <li shiro:authenticated="true" class="dropdown user user-menu" style="width: 160px!important;">
                        <a href="#" id="account" class="dropdown-toggle" data-toggle="dropdown">
                            <img th:src="${#strings.isEmpty(session.user.img)}?@{/img/person.png}:${session.user.img}"
                                 id="userImage" class="user-image img-circle"/>
                            <span class="hidden-xs" th:text="${session.user.name}">Alexander Pierce</span>
                        </a>

                        <ul class="dropdown-menu"
                            style="margin:0!important;width: 100px!important;padding: 0!important;">
                            <li style="width: 90px!important;" id="updateSign"><a style="padding: 0px"
                                                                                  href="javascript:void(0)"
                                                                                  class="pull-right"
                                                                                  onclick="js.modal.open('modal-updatePassword')"><i
                                    class="fa fa-edit">&nbsp;修改密码</i></a></li>
                            <li style="width: 90px!important;" id="updatePwd"><a style="padding: 0px"
                                                                                 href="javascript:void(0)"
                                                                                 class="pull-right"
                                                                                 onclick="js.modal.open('modal-upload')"><i
                                    class="fa fa-edit">&nbsp;修改头像</i></a></li>
                        </ul>
                    </li>
                    <li><a href="#">帮助文档</a></li>
                    <li><a th:href="@{/logout}"><i class="fa fa-sign-out">&nbsp;退出</i></a></li>
                </ul>
            </div>
        </nav>
    </header>

    <aside class="main-sidebar">
        <section class="sidebar">
            <ul class="sidebar-menu" data-widget="tree">

                <li class="treeview  menu-open">
                    <a href="#">
                        <i class="fa fa-folder-open text-green"></i>
                        <span>系统总览</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu" style="display: block;">
                        <!--<li class="active"><a target="content"><i class="fa  fa-pie-chart text-light-blue"></i> 首页</a>-->
                        <!--</li>-->
                        <li class="active"><a target="content" th:href="@{/main}"><i class="fa  fa-pie-chart text-light-blue"></i> 首页</a>
                        </li>
                        <li class="active"><a th:href="@{/overview/projectChangeQuery}" shiro:hasPermission="overview:projectChangeQuery:view"  target="content"><i class="fa  fa-search text-green"></i> 项目变更查询</a>
                        </li>
                        <li class="active"><a th:href="@{/main/productMix}"   target="content"><i class="fa  fa-search text-green"></i> 产品结构查询</a>
                        </li>
                    </ul>
                </li>

                <!--<li class="treeview">-->
                <!--<a href="#">-->
                <!--<i class="fa fa-folder-open text-orange"></i>-->
                <!--<span>统计报表管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>-->
                <!--</a>-->
                <!--<ul class="treeview-menu">-->
                <!--<li class="active"><a target="content"><i class="fa  fa-pie-chart text-light-blue"></i> 待定</a></li>-->
                <!--</ul>-->
                <!--</li>-->

                <li class="treeview" shiro:hasPermission="task:menu">
                    <a href="#">
                        <i class="fa fa-folder-open text-maroon"></i>
                        <span>商务任务管理</span><span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <!--<li class="active"><a th:href="@{/taskApply}"-->
                        <!--target="content"><i class="fa fa-bar-chart text-orange"></i> 下达申请</a></li>-->
                        <li class="active" shiro:hasPermission="task:relay:view"><a th:href="@{/taskApply}"
                                                                                    target="content"><i
                                class="fa fa-file-text-o text-green"></i> 商务任务下达
                            <span class="pull-right-container" th:if="${unTaskCnt } ge 0">
                                <small id="icgckCount" class="label pull-right bg-yellow" th:text="${unTaskCnt}">0</small>
                            </span></a>

                        </li>
                        <li class="active" shiro:hasPermission="task:list:view"><a th:href="@{/taskBoard}"
                                                                                   target="content"><i
                                class="fa fa-cogs text-blue"></i> 商务任务看板</a></li>
                        <li class="active" shiro:hasPermission="task:kpi:view"><a th:href="@{/userPerformanceSel}"
                                                                                  target="content"><i
                                class="fa fa-table text-lime"></i> 员工业绩查询</a></li>
                    </ul>
                </li>
<!--                <li class="treeview" shiro:hasPermission="rou:menu">-->
<!--                    <a href="#">-->
<!--                        <i class="fa fa-folder-open text-fuchsia"></i>-->
<!--                        <span>概算成本管理</span><span class="pull-right-container"><i-->
<!--                            class="fa fa-angle-left pull-right"></i></span>-->
<!--                    </a>-->
<!--                    <ul class="treeview-menu">-->
<!--                        <li shiro:hasPermission="rou:list:view">-->
<!--                            <a th:href="@{/estimateManage}" target="content">-->
<!--                                <i class="fa  fa-pie-chart text-fuchsia"></i>项目概算列表-->
<!--                                <lable id="estimateTaskCount" class="badge label-danger pull-right"></lable>-->
<!--                            </a>-->
<!--                        </li>-->
<!--                        <li shiro:hasPermission="rou:submit:view">-->
<!--                            <a th:href="@{/estimateManage/submitList}" target="content">-->
<!--                                <i class="fa  fa-pie-chart text-fuchsia"></i>概算成本清单提交-->
<!--                                <lable id="estimateTaskCount" class="badge label-danger pull-right"></lable>-->
<!--                            </a>-->
<!--                        </li>-->
<!--                    </ul>-->
<!--                </li>-->
<!--                <li class="treeview">-->
<!--                    <a href="#">-->
<!--                        <i class="fa fa-folder-open text-green"></i>-->
<!--                        <span>预算成本管理</span><span class="pull-right-container"><i-->
<!--                            class="fa fa-angle-left pull-right"></i></span>-->
<!--                    </a>-->
<!--                    &lt;!&ndash;                    <ul class="treeview-menu" style="display: block;">&ndash;&gt;-->
<!--                    &lt;!&ndash;                        <li class="active"><a th:href="@{/accounting}" target="content"><i class="fa  fa-pie-chart text-light-blue"></i>待核算项目</a></li>&ndash;&gt;-->
<!--                    &lt;!&ndash;                        <li class="active"><a th:href="@{/getData}" target="content"><i class="fa  fa-database text-fuchsia"></i>数据获取测试</a></li>&ndash;&gt;-->
<!--                    &lt;!&ndash;                    </ul>&ndash;&gt;-->
<!--                </li>-->
                <li class="treeview" shiro:hasPermission="ver:menu">
                    <a href="#">
                        <i class="fa fa-folder-open   text-lime"></i>
                        <span>核算成本管理</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">

                        <li shiro:hasPermission="ver:list:view">
                            <a th:href="@{/accountManage}" target="content">
                                <i class="fa  fa-pie-chart text-fuchsia"></i>项目核算列表
                                <lable id="accountTaskCount" class="label label-warning pull-right"></lable>
                            </a>
                        </li>
                        <li shiro:hasPermission="ver:submit:view"><a
                                th:href="@{/accountManage/submitList}" target="content"><i
                                class="fa fa-file-text-o text-green"></i>核算成本清单提交
                            <lable id="accountSubmitCount" class="label label-warning pull-right"></lable>
                        </a></li>
                        <li shiro:hasPermission="ver:audit:audit"><a
                                th:href="@{/accountManage/approvalList}" target="content"><i
                                class="fa fa fa-cogs text-red"></i>核算成本清单审核
                            <lable id="accountApprovalCount" class="label label-warning pull-right"></lable>
                        </a></li>
                        <li shiro:hasPermission="ver:query:vew"><a
                                th:href="@{/accountManage/queryPage}" target="content"><i
                                class="fa fa-search text-info"></i>核算成本清单查询
                        </a></li>
                    </ul>
                </li>
<!--                <li class="treeview" shiro:hasPermission="cost:menu">-->
<!--                    <a href="#" >-->
<!--                        <i class="fa fa-folder-open text-aqua"></i>-->
<!--                        <span>成本信息输出管理</span><span class="pull-right-container"><i-->
<!--                            class="fa fa-angle-left pull-right"></i></span>-->
<!--                    </a>-->
<!--                    <ul class="treeview-menu">-->
<!--                        <li class="treeview" shiro:hasPermission="costBlank:menu">-->
<!--                            <a href="#"  >-->
<!--                                <i class="fa fa-folder-open   text-lime"></i>-->
<!--                                <span>下料工时确认单</span>-->
<!--                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>-->
<!--                            </a>-->
<!--                            <ul class="treeview-menu">-->
<!--                                <li shiro:hasPermission="cost:Blank:view"><a  th:href="@{/craft/cost/blanking/create}"-->
<!--                                                                              target="content"><i class="fa fa-pencil-square  text-fuchsia" ></i> 下料工时确认单录入</a></li>-->
<!--                                <li shiro:hasPermission="cost:BlankList:view"><a th:href="@{/craft/cost/blanking/submit}"-->
<!--                                                                                 target="content"><i class="fa fa-bandcamp text-yellow" ></i> 下料工时确认单提交</a></li>-->
<!--                                <li shiro:hasPermission="cost:Blanking:view"><a th:href="@{/craft/cost/blanking/examine}"-->
<!--                                                                                target="content"><i class="fa fa-check-circle  text-lime" ></i> 下料工时确认单审核</a></li>-->
<!--                            </ul>-->
<!--                        </li>-->
<!--                        <li class="treeview" shiro:hasPermission="costRivet:menu">-->
<!--                            <a href="#"  >-->
<!--                                <i class="fa fa-folder-open   text-lime"    ></i>-->
<!--                                <span>铆焊工时确认单</span>-->
<!--                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>-->
<!--                            </a>-->
<!--                            <ul class="treeview-menu">-->
<!--                                <li shiro:hasPermission="cost:rivet:view"><a th:href="@{/craft/cost/solder/create}"-->
<!--                                                                             target="content"><i class="fa fa-pencil-square  text-fuchsia" ></i> 铆焊工时确认单录入</a></li>-->
<!--                                <li shiro:hasPermission="cost:rivetTime:view"><a th:href="@{/craft/cost/solder/submit}"-->
<!--                                                                                 target="content"><i class="fa fa-bandcamp text-yellow" ></i> 铆焊工时确认单提交</a></li>-->
<!--                                <li shiro:hasPermission="cost:rivetList:view"><a th:href="@{/craft/cost/solder/examine}"-->
<!--                                                                                 target="content"><i class="fa fa-check-circle  text-lime" ></i> 铆焊工时确认单审核</a></li>-->
<!--                            </ul>-->
<!--                        </li>-->


<!--                        <li class="treeview" shiro:hasPermission="costHeat:menu">-->
<!--                            <a href="#" >-->
<!--                                <i class="fa fa-folder-open   text-lime" ></i>-->
<!--                                <span>热处理确认单</span>-->
<!--                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>-->
<!--                            </a>-->
<!--                            <ul class="treeview-menu">-->
<!--                                <li shiro:hasPermission="cost:heat:view"><a th:href="@{/craft/cost/heat/create}"-->
<!--                                                                            target="content"><i class="fa fa-pencil-square  text-fuchsia" ></i> 热处理确认单录入</a></li>-->
<!--                                <li shiro:hasPermission="cost:heatment:view"><a th:href="@{/craft/cost/heat/submit}"-->
<!--                                                                                target="content"><i class="fa fa-bandcamp text-yellow" ></i> 热处理确认单提交</a></li>-->
<!--                                <li shiro:hasPermission="cost:heatList:view"><a th:href="@{/craft/cost/heat/examine}"-->
<!--                                                                                target="content"><i class="fa fa-check-circle  text-lime" ></i> 热处理确认单审核</a></li>-->
<!--                            </ul>-->
<!--                        </li>-->
<!--                        <li class="treeview" shiro:hasPermission="costAssemb:menu">-->
<!--                            <a href="#" >-->
<!--                                <i class="fa fa-folder-open   text-yellow"></i>-->
<!--                                <span>装配工时确认单</span>-->
<!--                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>-->
<!--                            </a>-->
<!--                            <ul class="treeview-menu">-->
<!--                                <li shiro:hasPermission="cost:assemb:view"><a th:href="@{/craft/cost/assembling/create}"-->
<!--                                                                              target="content"><i class="fa fa-pencil-square  text-fuchsia" ></i> 装配工时确认单录入</a></li>-->
<!--                                <li shiro:hasPermission="cost:assembing:view"><a th:href="@{/craft/cost/assembling/submit}"-->
<!--                                                                                 target="content"><i class="fa fa-bandcamp text-yellow" ></i> 装配工时确认单提交</a></li>-->
<!--                                <li shiro:hasPermission="cost:assembList:view"><a th:href="@{/craft/cost/assembling/examine}"-->
<!--                                                                                  target="content"><i class="fa fa-check-circle  text-lime" ></i> 装配工时确认单审核</a></li>-->
<!--                            </ul>-->
<!--                        </li>-->
<!--                        <li class="treeview" shiro:hasPermission="costPaint:menu">-->
<!--                            <a href="#" >-->
<!--                                <i class="fa fa-folder-open   text-yellow"></i>-->
<!--                                <span>涂装工时确认单</span>-->
<!--                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>-->
<!--                            </a>-->
<!--                            <ul class="treeview-menu">-->
<!--                                <li shiro:hasPermission="cost:Paint:view"><a  th:href="@{/craft/cost/paint/create}"-->
<!--                                                                              target="content"><i class="fa fa-pencil-square  text-fuchsia" ></i> 涂装工时确认单录入</a></li>-->
<!--                                <li shiro:hasPermission="cost:Painting:view"><a th:href="@{/craft/cost/paint/submit}"-->
<!--                                                                                target="content"><i class="fa fa-bandcamp text-yellow" ></i> 涂装工时确认单提交</a></li>-->
<!--                                <li shiro:hasPermission="cost:PaintList:view"><a th:href="@{/craft/cost/paint/examine}"-->
<!--                                                                                 target="content"><i class="fa fa-check-circle  text-lime" ></i> 涂装工时确认单审核</a></li>-->
<!--                            </ul>-->
<!--                        </li>-->
<!--                        <li class="treeview" shiro:hasPermission="costCarriage:menu">-->
<!--                            <a href="#" >-->
<!--                                <i class="fa fa-folder-open   text-maroon"></i>-->
<!--                                <span>包装运输确认单</span>-->
<!--                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>-->
<!--                            </a>-->
<!--                            <ul class="treeview-menu">-->
<!--                                <li shiro:hasPermission="cost:wrapEntering:view"><a th:href="@{/craft/cost/transport/create}"-->
<!--                                                                                    target="content"><i class="fa fa-pencil-square  text-fuchsia" ></i> 包装运输确认单录入</a></li>-->
<!--                                <li shiro:hasPermission="cost:wrapSubmit:view"><a th:href="@{/craft/cost/transport/submit}"-->
<!--                                                                                  target="content"><i class="fa fa-bandcamp text-yellow" ></i> 包装运输确认单提交</a></li>-->
<!--                                <li shiro:hasPermission="cost:wrapCheck:view"><a th:href="@{/craft/cost/transport/examine}"-->
<!--                                                                                 target="content"><i class="fa fa-check-circle  text-lime" ></i> 包装运输确认单审核</a></li>-->
<!--                            </ul>-->
<!--                        </li>-->
<!--                        <li class="treeview">-->
<!--                            <a href="#" shiro:hasPermission="costPainting:menu">-->
<!--                                <i class="fa fa-folder-open   text-maroon"></i>-->
<!--                                <span>安装工时确认单</span>-->
<!--                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>-->
<!--                            </a>-->
<!--                            <ul class="treeview-menu">-->
<!--                                <li shiro:hasPermission="cost:install:view"><a th:href="@{/craft/cost/install/create}"-->
<!--                                                                               target="content"><i class="fa fa-pencil-square  text-fuchsia" ></i> 安装工时确认单录入</a></li>-->
<!--                                <li shiro:hasPermission="cost:instPlan:view"><a th:href="@{/craft/cost/install/submit}"-->
<!--                                                                                target="content"><i class="fa fa-bandcamp text-yellow" ></i> 安装工时确认单提交</a></li>-->
<!--                                <li shiro:hasPermission="cost:instalList:view"><a th:href="@{/craft/cost/install/examine}"-->
<!--                                                                                  target="content"><i class="fa fa-check-circle  text-lime" ></i> 安装工时确认单审核</a></li>-->
<!--                            </ul>-->
<!--                        </li>-->
<!--                        <li shiro:hasPermission="cost:Planquery:view"><a th:href="@{/craft/cost/query}"-->
<!--                                                                         target="content"><i class="fa fa-search text-red" ></i> 成本信息输出查询</a></li>-->

<!--                    </ul>-->
<!--                </li>-->
<!--                <li class="treeview">-->
<!--                    <a href="#">-->
<!--                        <i class="fa fa-folder-open text-orange"></i>-->
<!--                        <span>报价模拟器</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>-->
<!--                    </a>-->
<!--                    <ul class="treeview-menu">-->
<!--                        <li class="active"><a target="content"><i class="fa fa-pie-chart text-blue"></i>待报价模拟列表</a></li>-->
<!--                        <li class="active"><a target="content"><i class="fa fa-bar-chart text-orange"></i>分项报价单提交</a>-->
<!--                        </li>-->
<!--                        <li class="active"><a target="content"><i class="fa fa-file-text-o text-green"></i>分项报价单审核</a>-->
<!--                        </li>-->
<!--                        <li class="active"><a target="content"><i class="fa fa-cogs text-red"></i>分项报价单批准</a></li>-->
<!--                        <li class="active"><a target="content"><i class="fa fa-table text-purple"></i>分项报价单查询</a></li>-->
<!--                    </ul>-->
<!--                </li>-->
                <li class="treeview" shiro:hasPermission="quo:menu">
                    <a href="#">
                        <i class="fa fa-folder-open text-purple"></i>
                        <span>报价管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu" >
                        <!--<li class="active"><a th:href="@{/quoteManage/quoteTaskList/page}" target="content"><i class="fa fa-pie-chart text-blue"></i>待报价列表</a></li>-->
                        <li class="active" shiro:hasPermission="quo:create:view"><a
                                th:href="@{/quoteManage/createQuotation/page}" target="content"><i
                                class="fa fa-bar-chart text-orange"></i>创建报价单</a></li>
                        <li class="active" shiro:hasPermission="quo:com:view"><a
                                th:href="@{/quoteManage/quotationManage/page}" target="content"><i
                                class="fa fa-file-text-o text-green"></i>报价单提交
                                    <span>
                                        <small id="quoteUnSubmitCount" class="label pull-right bg-red"></small>
                                    </span>
                                </a>
                        </li>
                        <li class="active" shiro:hasPermission="quo:audit:view"><a
                                th:href="@{/quoteManage/quoteApprove/page}" target="content"><i
                                class="fa fa-cogs text-red"></i>报价单审核
                                <span class="pull-right-container">
                                    <small id="quoteUnApproveCount" class="label pull-right bg-red"></small>
                                </span>
                            </a>
                        </li>
                        <li class="active" shiro:hasPermission="quo:compl:view"><a
                                th:href="@{/quoteManage/quotationQuery/page}" target="content"><i
                                class="fa fa-table text-purple"></i>报价单确认
                                <span class="pull-right-container">
                                    <small id="quoteUnConfirmCount" class="label pull-right bg-red"></small>
                                </span>
                            </a>
                        </li>
                        <li class="active" shiro:hasPermission="quo:search:view"><a
                                th:href="@{/quoteManage/quoteSearch/page}" target="content"><i
                                class="fa fa-search text-teal"></i>报价单查询</a></li>
                    </ul>
                </li>
                <li class="treeview" shiro:hasPermission="con:menu">
                    <a href="#">
                        <i class="fa fa-folder-open text-maroon"></i>
                        <span>合同管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li class="active" shiro:hasPermission="con:list:view"><a
                                th:href="@{/contractManage/unContractList}" target="content"><i
                                class="fa fa-bar-chart text-orange"></i> 待签合同列表</a></li>
                        <li class="active" shiro:hasPermission="con:agr:view"><a th:href="@{/contractManage/appendList}"
                                                                                 target="content"><i
                                class="fa fa-file-text-o text-green"></i> 创建增补合同</a></li>
                        <li class="active" shiro:hasPermission="con:com:view"><a
                                th:href="@{/contractManage/contractSubmit}" target="content"><i
                                class="fa fa-file-text-o text-green"></i> 合同提交</a></li>
                        <li class="active" shiro:hasPermission="con:audit:view"><a
                                th:href="@{/contractManage/unAppConList}" target="content"><i
                                class="fa fa-cogs text-lime"></i> 合同审核</a></li>

                        <li class="active" shiro:hasPermission="con:account:view"><a
                                th:href="@{/contractManage/contractList}" target="content"><i
                                class="fa fa-table text-blue"></i> 合同台帐查询</a></li>

                        <li class="active"><a th:href="@{/contractManage/contractSearch}" target="content"><i class="fa fa-table text-blue"></i> 合同状态查询</a></li>
                    </ul>
                </li>
                <li class="treeview" shiro:hasPermission="pay:menu">
                    <a href="#">
                        <i class="fa fa-folder-open text-teal"></i>
                        <span>款票管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li class="active" shiro:hasPermission="pay:list:view"><a th:href="@{/invoiceList/listIndex}"
                                                                                  target="content"><i
                                class="fa fa-bar-chart text-orange"></i> 项目款票列表</a></li>
                        <li class="active" shiro:hasPermission="pay:com:view">
                            <a th:href="@{/invoiceList/listIndex3}" target="content">
                                <i class="fa fa-file-text-o  text-green"></i> 款票提交
                                <lable id="accountKPSubmitCount" class="badge label-danger pull-right"></lable>
                            </a>
                        </li>
                        <li class="active" shiro:hasPermission="pay:audit:view">
                            <a th:href="@{/invoiceList/listIndex2}" target="content">
                                <i class="fa fa-cogs text-lime"></i> 款票审核
                                <lable id="accountKPExamineCount" class="badge label-danger pull-right"></lable>
                            </a>
                        </li>
                        <li class="active" shiro:hasPermission="pay:inqList:view"><a  th:href="@{/invoiceList/listIndex4}"
                                                                                      target="content"><i
                                class="fa fa-table text-blue"></i> 款票查询</a></li>
                    </ul>
                </li>

                <li class="treeview" shiro:hasPermission="basic:menu">
                    <a href="#">
                        <i class="fa fa-folder-open text-gray"></i>
                        <span>基础信息配置</span><span class="pull-right-container"><i
                            class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li class="active" shiro:hasPermission="basic:estbudacc:view"><a
                                th:href="@{/basicInfoConfig/basicConfig}" target="content"><i
                                class="fa fa-th-large text-blue"></i> 成本基础信息配置</a>
                        <li shiro:hasPermission="basic:macquota:view"><a
                                th:href="@{/basicInfoConfig/macQuotaConfig}" target="content"><i
                                class="fa fa-th-large text-blue"></i> 机加定额配置</a></li>
                        <li shiro:hasPermission="basic:working:view"><a th:href="@{/groupAllList}"
                               target="content"><i class="fa fa-th-large text-blue"></i> 工作组信息维护</a></li>
                        <li shiro:hasPermission="basic:dept:view"><a th:href="@{/basic/dept}"
                               target="content"><i class="fa fa-th-large text-blue"></i> 部门管理</a></li>
                        <li shiro:hasPermission="basic:org:view"><a th:href="@{/basic/org}"
                               target="content"><i class="fa fa-th-large text-blue"></i> 审核组织架构</a></li>
                        <li shiro:hasPermission="basic:dict:view"><a th:href="@{/basic/dict}"
                               target="content"><i class="fa fa-th-large text-blue"></i> 数据字典</a></li>
                        <li shiro:hasPermission="basic:verify:view"><a th:href="@{/basic/verify}"
                               target="content"><i class="fa fa-th-large text-blue"></i> 审核配置</a></li>
                        <li shiro:hasPermission="basic:seller:view"><a th:href="@{/basic/seller}"
                               target="content"><i class="fa fa-th-large text-blue"></i> 卖方信息</a></li>
                    </ul>

                </li>

                <li shiro:hasPermission="system:menu" class="treeview">
                    <a href="#">
                        <i class="fa fa-folder-open text-orange"></i>
                        <span>系统管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                    </a>
                    <ul class="treeview-menu">
                        <li shiro:hasPermission="system:user:view"><a th:href="@{/sys/user}" target="content"><i
                                class="fa fa-odnoklassniki-square text-red"></i> 帐号管理</a></li>
                        <li shiro:hasPermission="system:role:view"><a th:href="@{/sys/role}" target="content"><i
                                class="fa fa-tags text-yellow"></i> 角色管理</a></li>
                        <li shiro:hasPermission="system:permission:view"><a th:href="@{/sys/permission}" target="content"><i class="fa fa-briefcase text-blue"></i>
                            权限管理</a></li>
                        <li shiro:hasPermission="system:log:view"><a th:href="@{/sys/log}"  target="content"><i
                        class="fa fa-book text-green"></i> 操作日志</a></li>
                    </ul>
                </li>
            </ul>

        </section>
    </aside>

    <div class="content-wrapper">
        <!--<iframe id="content" th:src="@{/overview/index/}" scrolling="auto" frameborder="0" name="content" width="100%"-->
                <!--height="100%"></iframe>-->
        <iframe id="content" th:src="@{/main}" scrolling="auto" frameborder="0" name="content"
                width="100%" height="100%"></iframe>
    </div>
</div>

<div th:include="include :: footer"></div>
<script th:inline="javascript">
    /** 获取当前登录用户名 */
    function getUserName() {
        $.post(ctx + 'getLoginUserName',
            {},
            function (result) {
                $("#user_name").html(result.data);
                getImg();
            }, 'json')
    }

    /** 如果首页不在最顶层， 将最顶层改为首页 */
    if (window.parent.window !== window) {
        window.top.location = ctx;
    }

    /** 修改iframe框架高度 */
    function changeFrameHeight() {
        var ifm = document.getElementById("content");
        ifm.height = document.documentElement.clientHeight - 56;
    }

    /** 窗口大小改变事件 */
    window.onresize = function () {
        changeFrameHeight();
    };

    // /** 获取下任务消息 */
    // function getSend() {
    //     $("#unread-send").html('');
    //     $("#count-send").html('');
    //     $("#no-send").show();
    //     js.get({
    //         url: ctx + "send",
    //         success: function (result) {
    //             if (result.length > 0) {
    //                 $("#no-send").hide();
    //                 $("#count-send").html(result.length);
    //                 result.forEach(function (v, i, array) {
    //                     let img = ctx + "img/avatar.png";
    //                     $("#unread-send").append(`
    //                         <li><a class="message-send" target="_blank" href="${ctx + 'board/single/' + v.projectId + '/' + v.id}">
    //                         <div class="pull-left"> <img class="img-circle" alt="Image" src="${img}"></div>
    //                         <h4>系统通知<small><i class="fa fa-clock-o"></i>${v.createTime}</small></h4>
    //                         <p>${v.content}</p></a></li>
    //                     `);
    //                 })
    //             }
    //             js.modal.closeLoading();
    //
    //         }
    //     });
    // }
    //
    // /** 获取下任务消息 */
    // function getChange() {
    //     $("#unread-change").html('');
    //     $("#count-change").html('');
    //     $("#no-change").show();
    //     js.get({
    //         url: ctx + "change",
    //         success: function (result) {
    //             if (result.length > 0) {
    //                 $("#no-change").hide();
    //                 $("#count-change").html(result.length);
    //                 result.forEach(function (v, i, array) {
    //                     let img = ctx + "img/avatar.png";
    //                     $("#unread-change").append(`
    //                         <li><a class="message-change" target="_blank" href="${ctx + 'board/single/' + v.projectId + '/' + v.id}">
    //                         <div class="pull-left"> <img class="img-circle" alt="Image" src="${img}"></div>
    //                         <h4>系统通知<small><i class="fa fa-clock-o"></i>${v.createTime}</small></h4>
    //                         <p>${v.content}</p></a></li>
    //                     `);
    //                 })
    //             }
    //             js.modal.closeLoading();
    //
    //         }
    //     });
    // }

    // /**
    //  * 获取互动消息
    //  */
    // function getInteractive() {
    //     $("#unread-interactive").html('');
    //     $("#count-interactive").html('');
    //     $("#no-interactive").show();
    //     js.get({
    //         url: ctx + "receiver",
    //         success: function (result) {
    //             if (result.length > 0) {
    //                 $("#no-interactive").hide();
    //                 $("#count-interactive").html(result.length);
    //                 result.forEach(function (v, i, array) {
    //                     let img = v.sendUserImage == null ? (ctx + "img/avatar.png") : v.sendUserImage;
    //                     $("#unread-interactive").append(`
    //                         <li><a class="message-interactive" target="_blank" href="${ctx + 'board/single/' + v.projectId + '/' + v.id}">
    //                         <div class="pull-left"> <img class="img-circle" alt="Image" src="${img}"></div>
    //                         <h4>${v.sendUserName}<small><i class="fa fa-clock-o"></i>${v.createTime}</small></h4>
    //                         <p>${v.content}</p></a></li>
    //                     `);
    //                 })
    //             }
    //             js.modal.closeLoading();
    //
    //         }
    //     });
    // }

    // /**控制菜单显示*/
    // function roleControllerMenu() {
    //     var roles = [[${roleCodes}]];
    //     $("#W01").hide();
    //     $("#W02").hide();
    //     $("#W03").hide();
    //     var wcount=0;
    //     for (var i = 0; i < roles.length; i++) {
    //         if (roles[i] == "W01") {
    //             $("#W01").show();
    //             wcount++;
    //         }else
    //         if (roles[i] == "W02") {
    //             $("#W02").show();
    //             wcount++;
    //         }else
    //         if (roles[i] == "W03") {
    //             $("#W03").show();
    //             wcount++;
    //         }
    //     }
    //     if(wcount==0){
    //         $("#W01").show();
    //         $("#W02").show();
    //         $("#W03").show();
    //     }
    //
    //
    // }

    function imgFun(url, img) {
        var windowUrl = window.URL || window.webkitURL;//处理浏览器兼容性
        var xhr = new XMLHttpRequest();
        xhr.open("POST", url, true);
        xhr.responseType = "blob";
        xhr.setRequestHeader("Authorization", 'Bearer ');
        xhr.onload = function () {
            console.log(this);
            if (this.status == 200) {
                var blob = this.response;
                if (blob.size > 0) {
                    $(img).attr("src", windowUrl.createObjectURL(blob));
                } else {
                    $(img).attr("src", "/img/person.png");
                }
            }
        }
        xhr.send();
    }

    /**
     *  获取头像
     * */
    function getImg() {
        imgFun(ctx + "sys/user/getImg", $("#userImage"));

        // js.post({
        //     url: ctx + "sys/user/getImg",
        //     data: {},
        //     success: function (result) {
        //         if (result.type === web_status.SUCCESS) {
        //             $("#userImage").attr("src",window.URL.createObjectURL(result.data));
        //         }
        //     }
        // });
    }

    $(function () {
        // roleControllerMenu();
        /** 获取当前登录用户名 */
        getUserName();
        /** iframe 自动高度 */
        changeFrameHeight();
        /** 获取菜单项要显示的任务数 */
        getItemCount();
        /** 验证初始化 */
        js.validate.init("userForm", {
            fields: {
                password: {validators: {notEmpty: {message: '请输入密码'}}},
                rePassword: {
                    validators: {
                        notEmpty: {message: '请确认密码'},
                        identical: {field: 'password', message: '两次密码不一致'}
                    }
                }
            }
        });
        setInterval(getItemCount,5000);
        /** 修改密码 */
        $("#btn-updatePassword").click(function () {
            if (js.validate.isValid("userForm")) {
                js.post({
                    url: ctx + "update/user/pwd",
                    data: $("#userForm").serialize(),
                    success: function (result) {
                        if (result.type === web_status.SUCCESS) {
                            js.modal.success(result.msg);
                            js.modal.hide("modal-updatePassword");
                        } else {
                            js.modal.warning(result.msg);
                        }
                        js.modal.closeLoading();
                    }
                });
            }
        });


        /** 菜单栏点击事件 */
        $(".treeview-menu>li").click(function () {
            $(".treeview-menu>li").removeClass("active");
            $(this).addClass("active");
        });

        // /** 初始化WebSocket */
        // js.ws.init({
        //     // url: "ws://192.168.72.158:8080/websocket",
        //     url: "ws://192.168.50.3:8081/websocket",
        //     handler: function (msg) {
        //         if (msg.data === "INTERACTIVE") {
        //             getInteractive();
        //         } else if (msg.data === "SEND") {
        //             getSend();
        //         } else if (msg.data === "CHANGE") {
        //             getChange();
        //         }
        //     }
        // });

        /** 获取互动消息 */
        // getInteractive();

        /** 获取下任务消息 */
        // getSend();

        /** 获取项目变更消息 */
        // getChange();

        // /** 互动消息点击 */
        // $(document).on('click', ".message-interactive", function () {
        //     var count = parseInt($("#count-interactive").text());
        //     if (count > 1) {
        //         $("#count-interactive").text(count - 1);
        //     } else {
        //         $("#count-interactive").text('');
        //     }
        //     $(this).parent().remove();
        // });

        // /** 下任务点击 */
        // $(document).on('click', ".message-send", function () {
        //     var count = parseInt($("#count-send").text());
        //     if (count > 1) {
        //         $("#count-send").text(count - 1);
        //     } else {
        //         $("#count-send").text('');
        //     }
        //     $(this).parent().remove();
        // });
        //
        // /** 下任务点击 */
        // $(document).on('click', ".message-change", function () {
        //     var count = parseInt($("#count-change").text());
        //     if (count > 1) {
        //         $("#count-change").text(count - 1);
        //     } else {
        //         $("#count-change").text('');
        //     }
        //     $(this).parent().remove();
        // });


        initCropperInModal($('#photo'), $('#photoInput'), $('#modal-upload'));
        initCropperInModalSign($('#signImg'), $('#signInput'), $('#modal-sign'));


    });

    var initCropperInModal = function (img, input, modal) {
        var $image = img;
        var $inputImage = input;
        var $modal = modal;
        var options = {
            aspectRatio: 1, // 纵横比
            viewMode: 2,
            preview: '.img-preview' // 预览图的class名
        };
        // 模态框隐藏后需要保存的数据对象
        var saveData = {};
        var URL = window.URL || window.webkitURL;
        var blobURL;
        $modal.on('show.bs.modal', function () {
            // 如果打开模态框时没有选择文件就点击“打开图片”按钮
            if (!$inputImage.val()) {
                $inputImage.click();
            }
        }).on('shown.bs.modal', function () {
            // 重新创建
            $image.cropper($.extend(options, {
                ready: function () {
                    // 当剪切界面就绪后，恢复数据
                    if (saveData.canvasData) {
                        $image.cropper('setCanvasData', saveData.canvasData);
                        $image.cropper('setCropBoxData', saveData.cropBoxData);
                    }
                }
            }));
        }).on('hidden.bs.modal', function () {
            // 保存相关数据
            saveData.cropBoxData = $image.cropper('getCropBoxData');
            saveData.canvasData = $image.cropper('getCanvasData');
            // 销毁并将图片保存在img标签
            $image.cropper('destroy').attr('src', blobURL);
        });
        if (URL) {
            $inputImage.change(function () {
                var files = this.files;
                var file;
                if (!$image.data('cropper')) {
                    return;
                }
                if (files && files.length) {
                    file = files[0];
                    if (/^image\/\w+$/.test(file.type)) {

                        if (blobURL) {
                            URL.revokeObjectURL(blobURL);
                        }
                        blobURL = URL.createObjectURL(file);

                        // 重置cropper，将图像替换
                        $image.cropper('reset').cropper('replace', blobURL);

                        // 选择文件后，显示和隐藏相关内容
                        $('.img-container').removeClass('hidden');
                        $('.img-preview-box').removeClass('hidden');
                        $('#btn-upload').removeAttr('disabled').removeClass('disabled');
                        $('.tip-info').addClass('hidden');

                    } else {
                        window.alert('请选择一个图像文件！');
                    }
                }
            });
        } else {
            $inputImage.prop('disabled', true).addClass('disabled');
        }
    }

    var initCropperInModalSign = function (img, input, modal) {
        var $image = img;
        var $inputImage = input;
        var $modal = modal;
        var options = {
            aspectRatio: 3 / 1, // 纵横比
            viewMode: 2/*,
    preview: '.img-preview' // 预览图的class名*/
        };
        // 模态框隐藏后需要保存的数据对象
        var saveData = {};
        var URL = window.URL || window.webkitURL;
        var blobURL;
        $modal.on('show.bs.modal', function () {
            // 如果打开模态框时没有选择文件就点击“打开图片”按钮
            if (!$inputImage.val()) {
                $inputImage.click();
            }
        }).on('shown.bs.modal', function () {
            // 重新创建
            $image.cropper($.extend(options, {
                ready: function () {
                    // 当剪切界面就绪后，恢复数据
                    if (saveData.canvasData) {
                        $image.cropper('setCanvasData', saveData.canvasData);
                        $image.cropper('setCropBoxData', saveData.cropBoxData);
                    }
                }
            }));
        }).on('hidden.bs.modal', function () {
            // 保存相关数据
            saveData.cropBoxData = $image.cropper('getCropBoxData');
            saveData.canvasData = $image.cropper('getCanvasData');
            // 销毁并将图片保存在img标签
            $image.cropper('destroy').attr('src', blobURL);
        });
        if (URL) {
            $inputImage.change(function () {
                var files = this.files;
                var file;
                if (!$image.data('cropper')) {
                    return;
                }
                if (files && files.length) {
                    file = files[0];
                    if (/^image\/\w+$/.test(file.type)) {

                        if (blobURL) {
                            URL.revokeObjectURL(blobURL);
                        }
                        blobURL = URL.createObjectURL(file);

                        // 重置cropper，将图像替换
                        $image.cropper('reset').cropper('replace', blobURL);

                        // 选择文件后，显示和隐藏相关内容
                        $('.sign-img-container').removeClass('hidden');
                        // $('.img-preview-box').removeClass('hidden');
                        $('#btn-sign').removeAttr('disabled').removeClass('disabled');
                        $('.sign-tip-info').addClass('hidden');

                    } else {
                        window.alert('请选择一个图像文件！');
                    }
                }
            });
        } else {
            $inputImage.prop('disabled', true).addClass('disabled');
        }
    }
    /**200头像*/
    var sendPhoto = function () {
        var photo = $('#photo').cropper('getCroppedCanvas', {
            width: 300,
            height: 300
        }).toDataURL('image/png');

        $.post(ctx + "sys/user/edit/img", {imageData: photo}, function (result) {
            $('#userImage').attr('src', result.data);
            js.modal.hide("modal-upload");
        });
    }

    /**获取菜单项要显示的任务数*/
    function getItemCount() {
        $.post(
           ctx + "menu/getItemCount/accounting",
         {},
          function (result) {
                if (result.type === web_status.SUCCESS) {
                    if(result.data.accountTaskCount>0){
                        $("#accountTaskCount").text(result.data.accountTaskCount);
                    }else{
                        $("#accountTaskCount").hide();
                    }

                    if(result.data.accountSubmitCount>0){
                        $("#accountSubmitCount").text(result.data.accountSubmitCount);
                    }else{
                        $("#accountSubmitCount").hide();
                    }
                    if(result.data.accountSubmitCount>0){
                        $("#accountSubmitCount").text(result.data.accountSubmitCount);
                    }else{
                        $("#accountSubmitCount").hide();
                    }

                    if(result.data.accountApprovalCount>0){
                        $("#accountApprovalCount").text(result.data.accountApprovalCount);
                    }else{
                        $("#accountApprovalCount").hide();
                    }

                    if (result.data.accountKPSubmitCount > 0){
                        $("#accountKPSubmitCount").text(result.data.accountKPSubmitCount);
                    }else {
                        $("#accountKPSubmitCount").hide();
                    }

                    if (result.data.accountKPExamineCount > 0){
                        $("#accountKPExamineCount").text(result.data.accountKPExamineCount);
                    }else {
                        $("#accountKPExamineCount").hide();
                    }

                    if (result.data.quoteUnSubmitCount > 0){
                        $("#quoteUnSubmitCount").text(result.data.quoteUnSubmitCount);
                    }else {
                        $("#quoteUnSubmitCount").hide();
                    }

                    if (result.data.quoteUnApproveCount > 0){
                        $("#quoteUnApproveCount").text(result.data.quoteUnApproveCount);
                    }else {
                        $("#quoteUnApproveCount").hide();
                    }

                    if (result.data.quoteUnConfirmCount > 0){
                        $("#quoteUnConfirmCount").text(result.data.quoteUnConfirmCount);
                    }else {
                        $("#quoteUnConfirmCount").hide();
                    }
                }
            }
        );
    }
</script>
</body>
</html>
